package List;

import java.util.LinkedList;
import java.util.List;

/**
 * @Author:Cjj
 * @Date:2025/5/21
 * List
 */
public class TestList {
    public static void main(String[] args) {
        List list = new LinkedList();

        list.add("福满多");
        list.add("小当家");
        list.add("康师傅");
        list.add("康师傅");
  /*      System.out.println(list);

        list.remove("小当家");
        System.out.println(list);

       Object obj= list.get(1);
       String s=(String)obj;
        System.out.println(s);

        System.out.println(list);

        System.out.println(list.contains("康师傅"));*/

        for (int i = 0; i <list.size() ; i++) {
            String s= (String) list.get(i);//从字符串里拿数据 需要转型强转
            System.out.println(s);
        }
    }
}
